/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.evl.tecinfo.gui;


import br.com.evl.tecinfo.modelo.Area;
import br.com.evl.tecinfo.modelo.Permissao;
import br.com.evl.tecinfo.modelo.Usuario;
import javax.swing.JOptionPane;

/**
 *
 * @author Tecinfo
 */
public class Entrar extends javax.swing.JFrame {
 
    
   

    /**
     * Creates new form Entrar
     */
    public Entrar() {
        
        initComponents();
        setSize(480,400);
    
    }

    private Entrar(String text, String text0, int selectedIndex) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bt_entrar = new javax.swing.JButton();
        cb_selecionar = new javax.swing.JComboBox();
        ct_usuario = new javax.swing.JTextField();
        ct_senha = new javax.swing.JTextField();
        jl_area = new javax.swing.JLabel();
        jl_login = new javax.swing.JLabel();
        jl_usuario = new javax.swing.JLabel();
        jl_senha = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        bt_entrar.setText("Entrar");
        bt_entrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_entrarActionPerformed(evt);
            }
        });

        cb_selecionar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecionar", "Ed. Infantil", "Ens. Fundamental I", "Ens. Fundamental II", "Ens. Médio", "Serviço" }));
        cb_selecionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cb_selecionarActionPerformed(evt);
            }
        });

        jl_area.setText("Área:");

        jl_login.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jl_login.setText("LOGIN");

        jl_usuario.setText("Usuário:");

        jl_senha.setText("Senha/CPF:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(83, 83, 83)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jl_senha)
                    .addComponent(jl_usuario)
                    .addComponent(jl_area, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bt_entrar, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cb_selecionar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(ct_senha)
                        .addComponent(ct_usuario, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE))
                    .addComponent(jl_login, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(93, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addComponent(jl_login)
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jl_usuario)
                    .addComponent(ct_usuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jl_senha)
                    .addComponent(ct_senha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jl_area)
                    .addComponent(cb_selecionar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addComponent(bt_entrar)
                .addContainerGap(43, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bt_entrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_entrarActionPerformed
        /*    Area area_log = new Area ("João" , "Prof", 123);
         * Permissao p_log = new Permissao (area_log);
         * Usuario e = new Usuario(ct_usuario.getText(), ct_senha.getText(),p_log);*/
        
        int entrar = 0;
        // TODO add your handling code here:
       
          if(entrar==JOptionPane.YES_OPTION){
            JOptionPane.showMessageDialog(null,"Login realizado com Sucesso");
            ct_usuario.setText("");
            ct_senha.setText("");
            cb_selecionar.setSelectedIndex(0);
            
           
            
            
            
                
    }//GEN-LAST:event_bt_entrarActionPerformed
}
    private void cb_selecionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cb_selecionarActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_cb_selecionarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Entrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Entrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Entrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Entrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Entrar().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_entrar;
    private javax.swing.JComboBox cb_selecionar;
    private javax.swing.JTextField ct_senha;
    private javax.swing.JTextField ct_usuario;
    private javax.swing.JLabel jl_area;
    private javax.swing.JLabel jl_login;
    private javax.swing.JLabel jl_senha;
    private javax.swing.JLabel jl_usuario;
    // End of variables declaration//GEN-END:variables
}
